<?php
require_once 'nns_db_live_class.php';
require_once 'nns_db_live_index_class.php';
require_once 'nns_db_live_media_class.php';
require_once 'nns_db_live_playbill_class.php';

$result = array();

$live_obj = new nns_db_live_class();

/*
$catogery["pub_category_id"]='12';
$catogery["pri_category_id"]='22';
$catogery["pub_category_detail_id"]='32';
$catogery["pri_category_detail_id"]='42';

$tag[0]="1";
$tag[1]="1";
$tag[2]="1";
$tag[3]="0";
$tag[4]="0";
$tag[5]="0";
$tag[6]="0";

$live_info["director"]="kj2";
$live_info["actor"]="stone2";
$live_info["show_time"]="2010-09-04";
$live_info["view_len"]=10;
$live_info["all_index"]=4;
$live_info["new_index"]=1;
$live_info["area"]="china";

$summary="平凡的世界简介";
$remark="平凡的世界备注";

$images["image0"]="../upfile/nns_4";
$images["image1"]="../upfile/nns_5";
$images["image2"]="../upfile/nns_6";
$images["image3"]="../upfile/nns_8";
*/

//$result = $live_obj->nns_db_live_add('平凡的世界',1,$catogery,0,'orgid',$tag,$live_info,$summary,$remark);
//$result =$live_obj->nns_db_live_upload_images('2', $images);
//$result = $live_obj->nns_db_live_modify_images('2', $images);
//$result = $live_obj->nns_db_live_images_info('2');
//$temp=array(1,4,5);
//$result = $live_obj->nns_db_live_count('','',2,'','','','','','',NNS_live_DELETED_FALSE);
//
//$result = $live_obj->nns_db_live_modify('00edbf5eed70a18c317caf9852acd497','点播目录9',0,$catogery,49,'orgid9',$tag,$live_info,$summary,$remark);
//$result = $live_obj->nns_db_live_delete('00edbf5eed70a18c317caf9852acd497');
//$result = $live_obj->nns_db_live_retrieve('00edbf5eed70a18c317caf9852acd497');
//$result = $live_obj->nns_db_live_state('00edbf5eed70a18c317caf9852acd497', NNS_live_AND_MEDIA_STATE_ONLINE);
//$result = $live_obj->nns_db_live_check('d3a597a93b72fbea79bdd3a743424dfd', NNS_live_AND_MEDIA_CHECK_APPROVAL);
//$result = $live_obj->nns_db_live_info('00edbf5eed70a18c317caf9852acd497','nns_id,nns_name');



$index_obj = new nns_db_live_index_class();

//$result = $index_obj->nns_db_live_index_count('','水浒传');
//$result = $index_obj->nns_db_live_index_list();
//$result = $index_obj->nns_db_live_index_info('00edbf5eed70a18c317caf9852acd497', '1');
//$result= $index_obj->nns_db_live_index_modify('00edbf5eed70a18c317caf9852acd497',3,'水浒传6','','');
$index_obj = null;
$result = $live_obj->nns_db_live_list();

$live_obj = null;

$media_obj = new nns_db_live_media_class();

//$result = $media_obj->nns_db_live_media_add('872b5597f98174a0b36f04dd68b8a411', '红楼梦第8集','红楼梦第8集ipad源', 8, 'hd','1028', 1 , '28', 'ftp://193.168.1.8', 108 , '简介8' );
$temp_tag=array(1,4,5);
$result = $media_obj->nns_db_live_media_list(0,0,'872b5597f98174a0b36f04dd68b8a411',7,'2ee56887a669d44484d33afd2c7d59ef',$temp_tag,0,0,0);

//$result = $media_obj->nns_db_live_media_count('872b5597f98174a0b36f04dd68b8a411',7,'2ee56887a669d44484d33afd2c7d59ef',$temp_tag,'','','');
//$result = $media_obj->nns_db_live_media_state('889fe1e4cdc73622d14e747b0491f1e0', NNS_live_MEDIA_STATE_ONLINE);
//$result = $media_obj->nns_db_live_media_check('b3289a800413634cef4b7317b9a16fb3', NNS_live_MEDIA_CHECK_APPROVAL);
//$result = $media_obj->nns_db_live_media_delete('d8aad05b67dac08bc351dfbc6a62f7d4');
//$result = $media_obj->nns_db_live_media_retrieve('d8aad05b67dac08bc351dfbc6a62f7d4');
//$result = $media_obj->nns_db_live_media_modify('d8aad05b67dac08bc351dfbc6a62f7d4','水浒传第1集phone源xin',1,'ftp://198.46.34','9',0,'256');

$media_obj = null;

//$result = $media_obj->nns_db_curl('http://127.0.0.1/nn_core/nn_pub_api/nn_pub_api.php', 'live_content_add','','添加片源','ftp://192.168.1.1');
/*$xml = simplexml_load_string($result);
$ret = (string)$xml->result["ret"];
$contentid = (string)$xml->content["id"];

print_r ($xml);
echo $ret.":";
echo $contentid.":";*/

//$playbill = '<day day="20120321"><item begin="003800" time_len="3600" text="20120308"/><item begin="012000" time_len="3600" text="红楼梦 "/></day>';
//$playbill_ob=new nns_db_live_playbill_class();
//$result = $playbill_ob->nns_db_live_playbill_import('2', '20120321', $playbill);
//$result = $playbill_ob->nns_db_live_playbill_export('1', '20120317');
//$result = $playbill_ob->nns_db_live_playbill_count('2','','20120319','20120320','');
//$result = $playbill_ob->nns_db_live_playbill_list(0,0,'2','','20120318','20120320','');
//$result = $playbill_ob->nns_db_live_playbill_delete('2d2db16f92af1e8433b8f5ac0d06ad0c');
//$result = $playbill_ob->nns_db_live_playbill_info('ed50670ba4f45198d18f3d673e1a290e');

print_r ($result);
